// PersistentModify.h: interface for the PersistentModify class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PERSISTENTMODIFY_H__5A42A58C_9154_4D19_AA5C_8B27C2FF3EA1__INCLUDED_)
#define AFX_PERSISTENTMODIFY_H__5A42A58C_9154_4D19_AA5C_8B27C2FF3EA1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "PersistentVisitor.h"

namespace PersistentObjectOperation
{
	class DllExport PersistentModify : public PersistentVisitor  
	{
	public:
		PersistentModify();
		virtual ~PersistentModify();
	
	public:
		virtual BOOL Visit(Volume*& pVolume);
		virtual BOOL Visit(Part*& pPart);
		virtual BOOL Visit(SupportHanger*& pSH);
		virtual BOOL Visit(Joint*& pJoint);	
		
	private:
		void SaveProperty(PropertySystem::PropertyStack* pStack, const CString& strSHID, const UeObjectId& id);
		BOOL UpdatePartProperties(SupportHangerSubObject* pPart);
	};
	
	class DllExport PersistentModifyBatch : public PersistentVisitor
	{
	public:
		PersistentModifyBatch();
		virtual ~PersistentModifyBatch();

	public:
		virtual void EndPersistent();
		
	private:
		void SaveVolume();
		void SaveSH();
		void SaveJoint();
		void SavePart();
		void SaveProperty(PropertySystem::PropertyStack* pStack, const CString& strSHID, const UeObjectId& id);
		void InitPropertyPtr();

	private:
		_RecordsetPtr m_PropertyPtr;
	};
}
#endif // !defined(AFX_PERSISTENTMODIFY_H__5A42A58C_9154_4D19_AA5C_8B27C2FF3EA1__INCLUDED_)
